import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { Alert } from "../../../../com/mui/controls/Alert";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { GButton } from "../../../../com/mui/controls/GButton";
type int = number;
//class MarryDivorce
    
    export  class MarryDivorce extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            setSize(337, 283);
            titleHeight = 26;
            title = Language.getString(43646);
            this.addListeners();
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 11661311);
            loc1.leading = 2;
            ObjCreate.createBg(18, 41, 301, 189, this);
            ObjCreate.createTextField(Language.getString(43647), 25, 53, 290, 20, this, GlobalStyle.textFormat2);
            var loc2=ObjCreate.createTextField(Language.getString(43648), 25, 77, 290, 40, this, loc1);
            loc2.wordWrap = true;
            loc2.multiline = true;
            loc2 = ObjCreate.createTextField(Language.getString(43649), 25, 114, 290, 40, this, loc1);
            loc2.wordWrap = true;
            loc2.multiline = true;
            loc2 = ObjCreate.createTextField(Language.getString(43650), 25, 147, 290, 40, this, loc1);
            loc2.wordWrap = true;
            loc2.multiline = true;
            loc1 = new GTextFormat(FontUtil.songtiName, 12, 15788607);
            loc1.leading = 7;
            loc1.bold = true;
            loc2 = ObjCreate.createTextField(Language.getString(43651), 25, 182, 290, 40, this, loc1);
            loc2.wordWrap = true;
            loc2.multiline = true;
            this._btnDivorce = ObjCreate.createGButton(Language.getString(43652), 76, 236, 70, 26, this, "ButtonLarge");
            this._btnDivorceForce = ObjCreate.createGButton(Language.getString(43653), 198, 236, 70, 26, this, "ButtonLarge");
            return;
        }

        /* internal  */addListeners(): void
        {
            this._btnDivorce.addEventListener(flash.events.MouseEvent.CLICK, this.onDivorceClick);
            this._btnDivorceForce.addEventListener(flash.events.MouseEvent.CLICK, this.onDivorceForceClick);
            return;
        }

        /* internal  */onDivorceClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Alert.show(Language.getString(43654), null, Alert.OK | Alert.CANCEL, null, this.onCloseAlert);
            return;
        }

        /* internal  */onCloseAlert(arg1: int): void
        {
            if (arg1 == Alert.OK) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.MarryDivorceMarryConfirm, false));
            }
            return;
        }

        /* internal  */onDivorceForceClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Alert.show(Language.getString(43655), null, Alert.OK | Alert.CANCEL, null, this.onCloseForceAlert);
            return;
        }

        /* internal  */onCloseForceAlert(arg1: int): void
        {
            if (arg1 == Alert.OK) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.MarryDivorceMarryConfirm, true));
            }
            return;
        }

        /* internal */ /* var */_btnDivorce: GButton;

        /* internal */ /* var */_btnDivorceForce: GButton;
    }
